Skip to content

Create store view using the command line #29408

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: 2.4-develop
Choose a base branch
from

Conversation

0m3r
Copy link
Contributor

@0m3r 0m3r commented Aug 5, 2020

Description (*)

Create a new store view using the command line

Usage

➜  magento.local git:(master) ✗  bin/magento store:create -h 
Description:
  Create new store view (see list: bin/magento store:list)

Usage:
  store:create [options] [--] <name> <code> [<is_active> [<sort_order>]]

Arguments:
  name                       Put the store view name you want to create 
  code                        Put the code 
  is_active                  Status (enable/disable) [default: true]
  sort_order                Sort Order [default: 0]

Options:
  -g, --group_id[=GROUP_ID]  Group ID (php bin/magento store:list). [default: "1"]
  -h, --help                 Display this help message
  -q, --quiet                Do not output any message
  -V, --version              Display this application version
      --ansi                 Force ANSI output
      --no-ansi              Disable ANSI output
  -n, --no-interaction       Do not ask any interactive question
  -v|vv|vvv, --verbose       Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

➜  magento.local git:(master) ✗ bin/magento store:create "Deutschland" de 1 20 -g 1

Fixed Issues (if relevant)

  1. Fixes Create New CLI command: create store view community-features#288

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds are green)

@m2-assistant
Copy link

m2-assistant bot commented Aug 5, 2020

Hi @0m3r. Thank you for your contribution
Here is some useful tips how you can test your changes using Magento test environment.
Add the comment under your pull request to deploy test or vanilla Magento instance:

  • @magento give me test instance - deploy test instance based on PR changes
  • @magento give me 2.4-develop instance - deploy vanilla Magento instance

❗ Automated tests can be triggered manually with an appropriate comment:

  • @magento run all tests - run or re-run all required tests against the PR changes
  • @magento run <test-build(s)> - run or re-run specific test build(s)
    For example: @magento run Unit Tests

<test-build(s)> is a comma-separated list of build names. Allowed build names are:

  1. Database Compare
  2. Functional Tests CE
  3. Functional Tests EE,
  4. Functional Tests B2B
  5. Integration Tests
  6. Magento Health Index
  7. Sample Data Tests CE
  8. Sample Data Tests EE
  9. Sample Data Tests B2B
  10. Static Tests
  11. Unit Tests
  12. WebAPI Tests

You can find more information about the builds here

ℹ️ Please run only needed test builds instead of all when developing. Please run all test builds before sending your PR for review.

For more details, please, review the Magento Contributor Guide documentation.

⚠️ According to the Magento Contribution requirements, all Pull Requests must go through the Community Contributions Triage process. Community Contributions Triage is a public meeting.

🕙 You can find the schedule on the Magento Community Calendar page.

📞 The triage of Pull Requests happens in the queue order. If you want to speed up the delivery of your contribution, please join the Community Contributions Triage session to discuss the appropriate ticket.

🎥 You can find the recording of the previous Community Contributions Triage on the Magento Youtube Channel

✏️ Feel free to post questions/proposals/feedback related to the Community Contributions Triage process to the corresponding Slack Channel

@swnsma
Copy link
Contributor

swnsma commented Aug 7, 2020

Hi @0m3r!
Thank you for your contribution!
Before we start with code review, could you create a ticket in https://github.com/magento/community-features/

Adding of new feature need to be agreed with Magento Team first, so it could provide some delay in review.

@0m3r
Copy link
Contributor Author

0m3r commented Aug 10, 2020

Hi @0m3r!
Thank you for your contribution!
Before we start with code review, could you create a ticket in https://github.com/magento/community-features/

Adding of new feature need to be agreed with Magento Team first, so it could provide some delay in review.

magento/community-features#288

@VladimirZaets
Copy link
Contributor

Hi @0m3r, thanks for collaboration. Because it's new functionality it should be discussed with our PO first, due to it I move this PR to on-hold column

@ihor-sviziev
Copy link
Contributor

ihor-sviziev commented Oct 5, 2020

@VladimirZaets @sidolov @gabrieldagama is there any updates on it? 2.5 months are passed

@sivaschenko sivaschenko self-assigned this Oct 6, 2020
@sivaschenko
Copy link
Member

sivaschenko commented Oct 6, 2020

@ihor-sviziev @0m3r sorry for the delay, working with Product team to approve the new cool feature and set the priority for the pull request

@sivaschenko
Copy link
Member

@magento run Magento Health Index, Semantic Version Checker

@sivaschenko sivaschenko added Priority: P3 May be fixed according to the position in the backlog. Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround. labels Oct 6, 2020
@sivaschenko
Copy link
Member

The delivery of the new command confirmed with @nrkapoor

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0m3r thanks for the pull request! Can you please extract the business logic of store creation to a model and cover the functionality with integration tests

@sivaschenko
Copy link
Member

@0m3r the examples of integration tests can be found in dev/tests/integration directory.

Basically the integration test for GetDefaultStoreGroup should:

  1. Use a fixture to create storegorups/websites/etc
  2. Call GetDefaultStoreGroup::execute and verify the return value
  3. Rollback fixture will take care of the system cleanup

The integration test for CreateStore should:

  1. Call CreateStore::execute method passing the data from data provider (to enable variations)
  2. Load the create store to verify it's actually created
  3. Delete the created store

Integration tests have been proven to be more reliable as they are running the actual code without mocks and less fragile as they are not tied to the internal class implementation details like the sequence of calls, etc.

@engcom-Charlie
Copy link
Contributor

@0m3r could you please cover your changes by integration tests as mentioned #29408 (comment)?
Thank you.

@0m3r
Copy link
Contributor Author

0m3r commented Nov 12, 2020

@0m3r could you please cover your changes by integration tests as mentioned #29408 (comment)?
Thank you.

Sorry, I do not have time right now. too many other work

@0m3r
Copy link
Contributor Author

0m3r commented Dec 1, 2020

I found some error while integration tests running and fix it.
ed4a1fe

Related article

Знімок екрану з 2020-12-01 11-58-34

@0m3r
Copy link
Contributor Author

0m3r commented Dec 2, 2020

@sivaschenko please review my integration tests

phpunit.xml

         <testsuite name="CreateStoreSuit">
            <file>testsuite/Magento/Store/Model/CreateStoreTest.php</file>
            <file>testsuite/Magento/Store/Model/GetDefaultStoreGroupTest.php</file>
        </testsuite>
bin/magento dev:tests:run integration -c'--testsuite=CreateStoreSuit'

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0m3r thanks for the integration test coverage! Please see my review comments.

Also, I'd like to notify you that this pull request was prioritized as P3 that will affect the processing time (We will be able to process it only after P1, P2 PRs)

Copy link
Member

@sivaschenko sivaschenko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the updates @0m3r !

@0m3r 0m3r requested a review from sivaschenko January 8, 2021 09:45
@sivaschenko sivaschenko removed their assignment Apr 15, 2021
@sivaschenko sivaschenko removed their request for review April 15, 2021 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Store Priority: P3 May be fixed according to the position in the backlog. Progress: review Release Line: 2.4 Severity: S3 Affects non-critical data or functionality and does not force users to employ a workaround.
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

Create New CLI command: create store view
7 participants